package com.test.tagtest;

import java.util.Comparator;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/9 14:08
 */
public class PersonComparator implements Comparator<Person> {
    @Override
    public int compare(Person o1, Person o2) {
        if (o1.getAge() > o2.getAge()) {
            return 1;
        } else if (o1.getAge() < o2.getAge()) {
            return -1;
        }
        return 0;
    }
}
